<?
/**
 * Copyright 2007 Melange.
 *
 * This file is part of PHP-MELANGE.
 *
 * PHP-MELANGE is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * PHP-MELANGE is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with PHP-MELANGE; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 * @category    Melange
 * @package     php-melange
 * @subpackage  cms
 * @copyright   Copyright (c) 2007 Jeroen Simons. All rights reserved
 * @author      Jeroen Simons <jeroen@melange.nl>
 * @link        http://www.melange.nl/
 *
 */

require_once("cms/core/helper/Abstract.php");

class PHP_CMS_View_Helper_List_Edit extends PHP_CMS_View_Helper_Abstract {

    function edit($form, $fields=array()) {
?>

        <div class="ctrl" style="padding-left:2px">

            <img src="static.php?file=<?=$this->image("cms/core/view/gfx/arrow_ltr.png")?>" width="38" height="22" alt="" style="vertical-align:-7px" />
            <a href="javascript:checkAll('<?=get_class($form)?>')"><?=$this->pageContext->message("choose.check-all", _Core::BUNDLE)?></a> /
            <a href="javascript:uncheckAll('<?=get_class($form)?>')"><?=$this->pageContext->message("choose.uncheck-all", _Core::BUNDLE)?></a>

            &nbsp;|&nbsp;

            <select name="actions" onchange="this.form.action.value=this.options[this.selectedIndex].value">
                <option value=""><?=$this->pageContext->message("choose.with-selected", _Core::BUNDLE)?>:</option>
                <? foreach(array_keys($fields) as $key) { ?>
                    <option value="<?=$key?>" <?=$form->getAction() == $key ? " selected=\"selected\"" : ""?>><?=$fields[$key]?></option>
                <? } ?>
            </select>

            &nbsp;|&nbsp;

            <input class="button" type="submit" value="<?=$this->pageContext->message("button.go", _Core::BUNDLE)?>" />

        </div>


<?
    }
}
?>
